<?php

defined('SYSPATH') or die('No direct access allowed.');

/**
 * Service Request_Session
 */
class Model_Service_Request_Session extends Domain_Dao_Request_Session {

    public $_rep;

    /**
     * 
     */
    public function __construct()
    {
        $o_repository_manager = new Domain_Repositories_RepositoryManager;
        $this->_rep = $o_repository_manager->getRequest_SessionRepository();
    }

    /**
     *
     * @return <type>
     */
    public function load($id)
    {
        return $this->_rep->load($id);
    }

    /**
     *
     * @param <type> $offset
     * @param <type> $limit
     * @param <type> $filter
     * @param <type> $sort
     * @param <type> $count
     * @return <type>
     */
    public function load_all($is_count = false, $offset=null, $limit=null, $filter = null, $sort = null)
    {
        return $this->_rep->load_all($offset, $limit, $filter, $sort, $is_count);
    }

    /**
     *
     * @param Domain_Entities_User $o_entity
     * @return <type> 
     */
    public function insert($o_entity)
    {
        return $this->_rep->insert_by($o_entity);
    }

    /**
     *
     * @param Domain_Entities_User $o_entity
     * @return <type>
     */
    public function update($o_entity)
    {
        return $this->_rep->update_by($o_entity);
    }

    /**
     *
     * @param <type> $id
     * @return <type> 
     */
    public function delete($id)
    {
        return $this->_rep->delete_by($id);
    }
    
    public function get($session_key){
        $this->_rep->clear();
        $this->_rep->builder_select('session_key', array('where'=>'='), $session_key);
        return $this->_rep->query();
    }

}

?>
